﻿namespace DataCollection.Infrastructure
{
    public class Response
    {
        readonly static public int SuccessCode = 200;

        readonly static public int ErrorCode = -9999;

        /// <summary>
        /// 响应码
        /// </summary>
        public int Code { set; get; } = 9999;

        /// <summary>
        /// 消息
        /// </summary>
        public string Msg { set; get; } = string.Empty;

        /// <summary>
        /// 数据
        /// </summary>
        public object Data { set; get; } = new object();

        public Response(int code) { }

        public Response(int code, string msg) { }

        public Response(int code, string msg, object data) { }

        static public Response DefaultResponse()
        {
            return new Response(ErrorCode, "操作失败");
        }
    }
}
